/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package chen.mbeans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chen
 */
@Entity
@Table(name = "mygoods")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Mygoods.findAll", query = "SELECT m FROM Mygoods m")
    , @NamedQuery(name = "Mygoods.findByGoodsId", query = "SELECT m FROM Mygoods m WHERE m.goodsId = :goodsId")
    , @NamedQuery(name = "Mygoods.findByGoodsName", query = "SELECT m FROM Mygoods m WHERE m.goodsName = :goodsName")
    , @NamedQuery(name = "Mygoods.findByGoodsDes", query = "SELECT m FROM Mygoods m WHERE m.goodsDes = :goodsDes")
    , @NamedQuery(name = "Mygoods.findByGoodsPrice", query = "SELECT m FROM Mygoods m WHERE m.goodsPrice = :goodsPrice")
    , @NamedQuery(name = "Mygoods.findByGoodsNum", query = "SELECT m FROM Mygoods m WHERE m.goodsNum = :goodsNum")
    , @NamedQuery(name = "Mygoods.findByGoodsImg", query = "SELECT m FROM Mygoods m WHERE m.goodsImg = :goodsImg")})
public class Mygoods implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "goods_id")
    private Integer goodsId;
    @Basic(optional = false)
  
    @Column(name = "goods_name")
    private String goodsName;
    @Basic(optional = false)
  

    @Column(name = "goods_des")
    private String goodsDes;
    @Basic(optional = false)

    @Column(name = "goods_price")
    private float goodsPrice;
    @Basic(optional = false)

    @Column(name = "goods_num")
    private int goodsNum;
    @Basic(optional = false)
 
    @Column(name = "goods_img")
    private String goodsImg;

    public Mygoods() {
    }

    public Mygoods(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public Mygoods(Integer goodsId, String goodsName, String goodsDes, float goodsPrice, int goodsNum, String goodsImg) {
        this.goodsId = goodsId;
        this.goodsName = goodsName;
        this.goodsDes = goodsDes;
        this.goodsPrice = goodsPrice;
        this.goodsNum = goodsNum;
        this.goodsImg = goodsImg;
    }

    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsDes() {
        return goodsDes;
    }

    public void setGoodsDes(String goodsDes) {
        this.goodsDes = goodsDes;
    }

    public float getGoodsPrice() {
        return goodsPrice;
    }

    public void setGoodsPrice(float goodsPrice) {
        this.goodsPrice = goodsPrice;
    }

    public int getGoodsNum() {
        return goodsNum;
    }

    public void setGoodsNum(int goodsNum) {
        this.goodsNum = goodsNum;
    }

    public String getGoodsImg() {
        return goodsImg;
    }

    public void setGoodsImg(String goodsImg) {
        this.goodsImg = goodsImg;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (goodsId != null ? goodsId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Mygoods)) {
            return false;
        }
        Mygoods other = (Mygoods) object;
        if ((this.goodsId == null && other.goodsId != null) || (this.goodsId != null && !this.goodsId.equals(other.goodsId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "chen.mbeans.Mygoods[ goodsId=" + goodsId + " ]";
    }
    
}
